package com.atguigu.flyweight;

public class IntegerTest {
    public static void main(String[] args) {
        Integer x = Integer.valueOf(127);
        Integer y = new Integer(127);
        Integer z = Integer.valueOf(127);
        Integer w = new Integer(127);

        System.out.println(x.equals(y));
        System.out.println();
        System.out.println(x == y);
        System.out.println(x == z);
        System.out.println(w == x);
        System.out.println(w == y);

        System.out.println("----------");

        Integer x1 = Integer.valueOf(128);
        Integer y1 = new Integer(128);
        Integer z1 = Integer.valueOf(128);
        Integer w1 = new Integer(128);

        System.out.println(x1.equals(y1));
        System.out.println();
        System.out.println(x1 == y1);
        System.out.println(x1 == z1);
        System.out.println(w1 == x1);
        System.out.println(w1 == y1);
    }
}
